﻿using System;
using System.Collections.Generic;
using System.Globalization;

namespace UniRx
{
	// Token: 0x020003AD RID: 941
	[Serializable]
	public struct Timestamped<T> : IEquatable<Timestamped<T>>
	{
		// Token: 0x06001345 RID: 4933 RVA: 0x000581ED File Offset: 0x000565ED
		public Timestamped(T value, DateTimeOffset timestamp)
		{
			this._timestamp = timestamp;
			this._value = value;
		}

		// Token: 0x1700014C RID: 332
		// (get) Token: 0x06001346 RID: 4934 RVA: 0x000581FD File Offset: 0x000565FD
		public T Value
		{
			get
			{
				return this._value;
			}
		}

		// Token: 0x1700014D RID: 333
		// (get) Token: 0x06001347 RID: 4935 RVA: 0x00058205 File Offset: 0x00056605
		public DateTimeOffset Timestamp
		{
			get
			{
				return this._timestamp;
			}
		}

		// Token: 0x06001348 RID: 4936 RVA: 0x00058210 File Offset: 0x00056610
		public bool Equals(Timestamped<T> other)
		{
			return other.Timestamp.Equals(this.Timestamp) && EqualityComparer<T>.Default.Equals(this.Value, other.Value);
		}

		// Token: 0x06001349 RID: 4937 RVA: 0x00058251 File Offset: 0x00056651
		public static bool operator ==(Timestamped<T> first, Timestamped<T> second)
		{
			return first.Equals(second);
		}

		// Token: 0x0600134A RID: 4938 RVA: 0x0005825B File Offset: 0x0005665B
		public static bool operator !=(Timestamped<T> first, Timestamped<T> second)
		{
			return !first.Equals(second);
		}

		// Token: 0x0600134B RID: 4939 RVA: 0x00058268 File Offset: 0x00056668
		public override bool Equals(object obj)
		{
			if (!(obj is Timestamped<T>))
			{
				return false;
			}
			Timestamped<T> other = (Timestamped<T>)obj;
			return this.Equals(other);
		}

		// Token: 0x0600134C RID: 4940 RVA: 0x00058290 File Offset: 0x00056690
		public override int GetHashCode()
		{
			int num;
			if (this.Value == null)
			{
				num = 1979;
			}
			else
			{
				T value = this.Value;
				num = value.GetHashCode();
			}
			int num2 = num;
			return this._timestamp.GetHashCode() ^ num2;
		}

		// Token: 0x0600134D RID: 4941 RVA: 0x000582E2 File Offset: 0x000566E2
		public override string ToString()
		{
			return string.Format(CultureInfo.CurrentCulture, "{0}@{1}", new object[]
			{
				this.Value,
				this.Timestamp
			});
		}

		// Token: 0x04000B67 RID: 2919
		private readonly DateTimeOffset _timestamp;

		// Token: 0x04000B68 RID: 2920
		private readonly T _value;
	}
}
